package com.cx330;

import java.util.StringJoiner;

public class Example52_01 {
    public static void main(String[] args) {
        String[] arr = {"hello", "world", "java"};
        StringJoiner joiner = new StringJoiner("-", "(", ")");
        for (int i = 0; i < arr.length; i++) {
            joiner.add(arr[i]);
        }
        System.out.println(joiner); // (hello-world-java)
    }
}
